package com.ioidea.base

import android.view.Window
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import androidx.core.view.WindowInsetsControllerCompat

/**
 * @author: hemin
 * @date: 2024/6/24
 * @Desc:
 */
object StatusBarHelper {
     var window:Window? = null

    /**
     * 有的statusbar是蓝色有的是白色 需要更换
     */
    fun changeStatusColor(color: Color){
        val insetsController = WindowInsetsControllerCompat(window!! , window!!.decorView)
        insetsController.isAppearanceLightStatusBars = color == Color.White
        window!!.statusBarColor = color.toArgb()
    }
}